<template>
  <div>
    <button>PointRouter</button>
    <!--  vue 自定义组件的 属性 事件 和插槽（子标签） -->
    <div>单价： <InputNumber :init="0"></InputNumber></div>
    <div>数量: <InputNumber :init="1"></InputNumber></div>
    <ElInputNumber v-model="a"></ElInputNumber>

    <ElForm style="width: 200px" label-width="auto">
      <ElFormItem label="用户名">
        <ElInput v-model="account.username"></ElInput>
      </ElFormItem>
      <ElFormItem label="密码">
        <ElInput v-model="account.password"></ElInput>
      </ElFormItem>
      <ElFormItem>
        <ElButton type="primary" @click="login">登录</ElButton>
      </ElFormItem>
    </ElForm>
  </div>
</template>
<script lang="ts">
/**
 * 页面核心数据结构体说明文档
 *
 *
 */
// import from
// 自定义组件
import InputNumber from '@/components/InputNumber.vue'
import axios from 'axios'
export default {
  name: 'PointRouter',
  components: {
    InputNumber: InputNumber
  },
  props: {
    sampleP: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      sampleD: 'value',
      a: 10,
      account: {
        username: '',
        password: ''
      }
    }
  },
  computed: {
    /* sampleC() {
      return this.sampleD + "--";
    }, */
  },
  created() {},
  mounted() {},
  methods: {
    // sampleM() {},
    async login(){
      console.log("将要发送请求",this.account)
      const res = await axios({
        method:'post',
        url:'http://localhost:8080/login',
        data:`username=${this.account.username}&password=${this.account.password}`,
      })
      
      
    }
  },
  watch: {
    // sampleP(n, o) {},
  }
}
</script>

<!--<style scoped>-->
<style lang="scss" scoped></style>
